package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.domain.DTO.LoginDTO;
import com.itheima.domain.entity.JobStatistics;
import com.itheima.domain.pojo.Emp;
import com.itheima.domain.query.QueryParam;
import com.itheima.domain.vo.GenderInfo;
import com.itheima.domain.vo.LoginVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author:篍
 * @Date: 2025/07/11 15:16
 * @Description:
 */
@Mapper
public interface EmpMapper {

    /**
     * 条件查询
     * @param empQueryParam 请求参数包装
     * @return
     */
//    @Select("select emp.*,dept.name dept_name from emp left join dept on emp.dept_id = dept.id" +
//            " where emp.name like concat('%',#{name},'%') and emp.gender=#{gender} and " +
//            "emp.entry_date between #{begin} and #{end}")
    Page<Emp> empPage(QueryParam empQueryParam);


    void addEmp(Emp emp);

    List<Emp> findAllEmp();

    void deleteByIds(@Param("ids") Integer[] ids);

    List<String> getImagesByIds(@Param("ids") Integer[] ids);

    Emp findEmpById(Integer id);

    void updateEmp(Emp emp);

    Integer findUsernameIfExist(String username);

    Integer findPhoneIfExist(String phone);

    List<JobStatistics> getEmpJobData();

    List<GenderInfo> getGenderData();

    long countEmpByDeptId(Integer deptId);

    Emp findEmpByUsername(String username);
}
